
import request from '@/utils/request'

// 中医相关接口

// 标签列表
export function getTagList(query) {
  return request({
    url: '/tcm-disease-tag/list',
    method: 'get',
    params: query
  })
}

// 新增标签
export function addTag(data) {
  return request({
    url: '/tcm-disease-tag/create',
    method: 'post',
    data
  })
}

// 修改标签
export function updateTag(data) {
  return request({
    url: '/tcm-disease-tag/update',
    method: 'post',
    data
  })
}

// 删除标签
export function  deleteTag(id) {
  return request({
    url: `/tcm-disease-tag/delete/${id}`,
    method: 'post'
  })
}

// 根据标签ID获取标签
export function getTagDetails(id) {
  return request({
    url: `/tcm-disease-tag/${id}`,
    method: 'get'
  })
}

// 药材列表
export function getDrugList(query) {
  return request({
    url: '/tcm-materials/list',
    method: 'get',
    params: query
  })
}

// 新增药材
export function addDrug(data) {
  return request({
    url: '/tcm-materials/create',
    method: 'post',
    data
  })
}

// 修改药材
export function updateDrug(data) {
  return request({
    url: '/tcm-materials/update',
    method: 'post',
    data
  })
}

// 删除药材
export function deleteDrug(id) {
  return request({
    url: `/tcm-materials/delete/${id}`,
    method: 'post'
  })
}

// 根据id获取药材
export function getDrugDetails(id) {
  return request({
    url: `/tcm-materials/${id}`,
    method: 'get'
  })
}

// 批量设置药材最大剂量
export function batchSetDoseMax(data) {
  return request({
    url: `/tcm-materials/batchSetDoseMax`,
    method: 'get',
    params: data
  })
}


// 药材冲突列表
export function getClashList(query) {
  return request({
    url: '/tcm-materials-conflict/list',
    method: 'get',
    params: query
  })
}

// 新增药材冲突
export function addClash(data) {
  return request({
    url: `/tcm-materials-conflict/create`,
    method: 'post',
    data
  })
}

// 修改药材冲突
export function updateClash(data) {
  return request({
    url: `/tcm-materials-conflict/update`,
    method: 'post',
    data
  })
}

// 删除药材冲突
export function deleteClash(id) {
  return request({
    url: `/tcm-materials-conflict/delete/${id}`,
    method: 'post'
  })
}

// 获取药材冲突详情
export function getClashDetails(id) {
  return request({
    url: `/tcm-materials-conflict/${id}`,
    method: 'get'
  })
}

// 获取处方列表
export function getPrescriptList(query) {
  return request({
    url: '/tcm-prescript/list',
    method: 'get',
    params: query
  })
}

// 新增处方
export function addPrescript(data) {
  return request({
    url: '/tcm-prescript/create',
    method: 'post',
    data
  })
}

// 编辑处方
export function updatePrescript(data) {
  return request({
    url: '/tcm-prescript/update',
    method: 'post',
    data
  })
}

// 删除处方
export function deletePrescript(id) {
  return request({
    url: `/tcm-prescript/delete/${id}`,
    method: 'post'
  })
}

// 获取处方详情
export function getPrescriptDetails(id) {
  return request({
    url: `/tcm-prescript/${id}`,
    method: 'get'
  })
}

// 获取证型列表
export function getTCMList(query) {
  return request({
    url: '/tcm-types/list',
    method: 'get',
    params: query
  })
}

// 新增证型
export function addTCM(data) {
  return request({
    url: `/tcm-types/create`,
    method: 'post',
    data
  })
}

// 修改证型
export function updateTCM(data) {
  return request({
    url: `/tcm-types/update`,
    method: 'post',
    data
  })
}

// 删除证型
export function deleteTCM(id) {
  return request({
    url: `/tcm-types/delete/${id}`,
    method: 'post'
  })
}

// 获取疾病列表
export function getDiseaseList(query) {
  return request({
    url: '/tcm-disease/list',
    method: 'get',
    params: query
  })
}

// 新增疾病
export function addDisease(data) {
  return request({
    url: `/tcm-disease/create`,
    method: 'post',
    data
  })
}

// 修改疾病
export function updateDisease(data) {
  return request({
    url: `/tcm-disease/update`,
    method: 'post',
    data
  })
}

// 删除疾病
export function deleteDisease(id) {
  return request({
    url: `/tcm-disease/delete/${id}`,
    method: 'post'
  })
}

// 获取疾病详情
export function getDiseaseDetails(id) {
  return request({
    url: `/tcm-disease/${id}`,
    method: 'get'
  })
}

// 获取九种体质列表
export function getConstitutionList(query) {
  return request({
    url: `/tcm-constitution/list`,
    method: 'get',
    params: query
  })
}

// 新增九种体质
export function addConstitution(data) {
  return request({
    url: `/tcm-constitution/create`,
    method: 'post',
    data
  })
}

// 修改九种体质
export function updateConstitution(data) {
  return request({
    url: `/tcm-constitution/update`,
    method: 'post',
    data
  })
}

// 删除九种体质
export function deleteConstitution(id) {
  return request({
    url: `/tcm-constitution/delete/${id}`,
    method: 'post'
  })
}

// 获取九种体质详情
export function getConstitutionDetails(id) {
  return request({
    url: `/tcm-constitution/${id}`,
    method: 'get'
  })
}

// 查询九种体质问卷
export function getConstitutionQuestionnaire() {
  return request({
    url: `/tcm-questionnaire/getConstitutionQuestionnaire`,
    method: 'get'
  })
}

// 删除九种体质
export function updateConstitutionQuestionnaire(data) {
  return request({
    url: `/tcm-questionnaire/update`,
    method: 'post',
    data
  })
}

// 设置虚拟辩证次数
export function setFictitious(data) {
  return request({
    url: `/tcm-disease/fictitious/set`,
    method: 'post',
    data
  })
}

// 用法管理列表
export function getUsageList(query) {
  return request({
    url: `/tcm/usage/setting/list`,
    method: 'get',
    params: query
  })
}

// 新增用法
export function addUsage(data) {
  return request({
    url: `/tcm/usage/setting/add`,
    method: 'post',
    data
  })
}

// 编辑用法
export function updateUsage(data) {
  return request({
    url: `/tcm/usage/setting/update`,
    method: 'post',
    data
  })
}

// 删除用法
export function deleteUsage(data) {
  return request({
    url: `/tcm/usage/setting/delete`,
    method: 'post',
    data
  })
}

// 穴位分组列表
export function getAcupointGroupList(query) {
  return request({
    url: `/tcm/acupoint/setting/group/list`,
    method: 'get',
    params: query
  })
}

// 新增穴位分组
export function addAcupointGroup(data) {
  return request({
    url: `/tcm/acupoint/setting/group/add`,
    method: 'post',
    data
  })
}

// 编辑穴位分组
export function updateAcupointGroup(data) {
  return request({
    url: `/tcm/acupoint/setting/group/update`,
    method: 'post',
    data
  })
}

// 删除穴位分组
export function deleteAcupointGroup(data) {
  return request({
    url: `/tcm/acupoint/setting/group/delete`,
    method: 'post',
    data
  })
}

// 穴位列表
export function getAcupointList(query) {
  return request({
    url: `/tcm/acupoint/setting/list`,
    method: 'get',
    params: query
  })
}

// 新增穴位
export function addAcupoint(data) {
  return request({
    url: `/tcm/acupoint/setting/add`,
    method: 'post',
    data
  })
}

// 编辑穴位
export function updateAcupoint(data) {
  return request({
    url: `/tcm/acupoint/setting/update`,
    method: 'post',
    data
  })
}

// 删除穴位
export function deleteAcupoint(data) {
  return request({
    url: `/tcm/acupoint/setting/delete`,
    method: 'post',
    data
  })
}

// 药材类别列表
export function getDrugCategoryList(query) {
  return request({
    url: `/tcm/category/setting/list`,
    method: 'get',
    params: query
  })
}

// 新增药材类别
export function addDrugCategory(data) {
  return request({
    url: `/tcm/category/setting/add`,
    method: 'post',
    data
  })
}

// 编辑药材类别
export function updateDrugCategory(data) {
  return request({
    url: `/tcm/category/setting/update`,
    method: 'post',
    data
  })
}

// 删除药材类别
export function deleteDrugCategory(data) {
  return request({
    url: `/tcm/category/setting/delete`,
    method: 'post',
    data
  })
}

// 获取穴位树
export function getAcupointTree() {
  return request({
    url: `/tcm/acupoint/setting/tree`,
    method: 'get'
  })
}

// 药材类别列表
export function getClassManageList(query) {
  return request({
    url: `/tcm-materials/category/list`,
    method: 'get',
    params: query
  })
}

// 新增药材类别
export function addDrugClass(data) {
  return request({
    url: `/tcm-materials/category/add`,
    method: 'post',
    data
  })
}

// 修改药材类别
export function updateDrugClass(data) {
  return request({
    url: `/tcm-materials/category/update`,
    method: 'post',
    data
  })
}

// 删除药材类别
export function deleteDrugClass(data) {
  return request({
    url: `/tcm-materials/category/delete`,
    method: 'post',
    data
  })
}
